/**
 * Copyright (c) 2013 onionframework.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.onionframework.event;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import org.springframework.context.ApplicationEvent;

/**
 * Marks a method as an observer of an event type or multiple event types.
 */
@Target(METHOD)
@Retention(RUNTIME)
@Documented
public @interface Observer {
	
	/**
	 * @return 要监听的事件的名称，推荐用包名风格的命名空间
	 */
	String[] value() default {};

	/**
	 * 要监听的事件类型
	 */
	Class<? extends ApplicationEvent>[] type() default {};
}
